package com.rt.easyjava.base.biz1.bean;


import com.baomidou.mybatisplus.annotation.TableName;
import com.rt.easyjava.base.biz1.bean.base.TmptAuthDept;
import com.rt.easyjava.common.base.UserDetailsDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 *
 * @author wuxiaoyong
 * @since 2020-07-17
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
//@Builder
//@AllArgsConstructor
//@NoArgsConstructor
@TableName(value = "tmpt_auth_dept")
public class TmptAuthDeptBiz extends TmptAuthDept{

    // 数据访问边界 0：全部数据， 10：机构内部数据
    @Override
    public void rebuildDataLimitQueryBean(UserDetailsDto userDetailsDto){
        int dataLimitType = userDetailsDto.getDataLimitType();
        if (dataLimitType >= 10) {
            this.setId(Long.parseLong(userDetailsDto.getCompanyId()));
        }
    }
}
